import { Overlay } from './overlay.js';

export class VirtualTrigger {
    /** @type {number} */
    x = 0;
    /** @type {number} */
    y = 0;

    constructor(x, y) {
        this.x = x;
        this.y = y;
    }

    /**
     * @public
     * @function updateBoundingClientRect
     * @param x {number}
     * @param y {number}
     */
    updateBoundingClientRect(x, y) {
        this.x = x;
        this.y = y;
        Overlay.update();
    }

    /**
     * @public
     * @function getBoundingClientRect
     * @return {DOMRect}
     */
    getBoundingClientRect() {
        return {
            width: 0,
            height: 0,
            top: this.y,
            right: this.x,
            y: this.y,
            x: this.x,
            bottom: this.y,
            left: this.x,
            toJSON() {
                return;
            },
        };
    }
}
